/*
 * Copyright (C) 2022 KylinSoft Co., Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef WIRELESSSTATUS_H
#define WIRELESSSTATUS_H

#include <QObject>
#include <QDebug>
#include <QDBusInterface>
#include <QDBusReply>
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
#include <QtQml/qqml.h>
#endif

//提供给Qml无线网络状态信号的类
class WirelessStatus : public QObject
{
    Q_OBJECT
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
    QML_ELEMENT
#endif

public:
    Q_PROPERTY(qlonglong wiredState READ getWiredState NOTIFY wiredStateChanged)

    WirelessStatus(QObject *parent = nullptr);

    bool m_bLanInitStatus;

    qlonglong getWiredState() const;

    qlonglong wifiStateChange();

private:
    qlonglong myState;

signals:
    void wiredStateChanged(int strength);

private slots:
    void onPropertiesChanged(QVariantMap str);
};
#endif // WIRELESSSTATUS_H

